<?php
namespace App\Services;

use App\Mail\SendVerificationCode;
use Illuminate\Support\Facades\Mail;

class EmailService {

    public static $errorMessage = "";

    public static function sendEmail($email, $code) {

        try {
            Mail::to($email)->send(new SendVerificationCode($code));

            return true;
        } catch (\Exception $exception) {
            self::$errorMessage = $exception->getMessage();

            return false;
        }
    }
}
